Analysis and Optimization of CHR Programs
نویسنده
چکیده
Introduction. Constraint Handling Rules (CHR) [2] is a high-level, powerful, yet relatively simple “no box” CLP language, embedded in a host language, commonly Prolog. It is based on multi-headed committed-choice rules. Recent implementations of CHR consist of a compiler which translates a CHR program to host language code, and a run-time system implementing the constraint store. Originally, CHR was designed for rapid prototyping of user-defined constraint solvers. In the early years of CHR limited attention went to optimized compilation. As a consequence, the reference implementation of CHR [4] comprises a general compilation schema, with only a small number of optimizations. Currently, CHR is increasingly used as a general-purpose programming language in a wide range of applications. Therefore, performance becomes more important, and recently, more advanced compilation optimizations have been proposed [3]. Several implementations of CHR exist [10]. The K.U.Leuven CHR system [11] includes a state-of-the-art CHR compiler for popular Prolog systems like SWI-Prolog and XSB. The formulation of the refined operational semantics of CHR [1], and subsequently the formulation of the call-based refined operational semantics [5], have captured the essentials of current implementations on a formal level. Optimizations can now be defined formally and their correctness w.r.t. the operational semantics can be proved. The main goals of my research are to improve the practical usability of CHR, to allow a more declarative use of CHR, and to compile CHR programs to more efficient host language code. These goals are achieved by developping, implementing, and evaluating analyses and optimizations for CHR programs.
منابع مشابه
Using Program Analysis for Integration and Optimization of Rule-based Constraint Solvers
ABSTRACT. One lesson learned from practical applications is that constraints are often heterogeneous. Solving such constraints requires a collaboration of constraint solvers. In this paper, we introduce a methodology for the tight integration of CHR constraint solver programs into one such program. CHR is a high-level rule-based language for writing constraint solvers and reasoning systems. A c...
متن کاملSuspension Optimization and In-place Updates for Optimizing CHR Compilation
We introduce two CHR compiler optimizations aimed at reducing garbage creation by reusing suspension terms, used to represent the CHR constraints. We have implemented both optimizations in the K.U.Leuven CHR system. The optimizations dramatically improve the memory footprint and speed of CHR programs: in several benchmarks we have measured speedups of 40% and more, and a reduction of memory usa...
متن کاملPresenting the strategy of Iran-Iraq trade interactions based on importance-performance analysis
The development of trade with Islamic countries in the region, especially its neighbors, is important because it reduces the vulnerability of the countrychr(chr(chr(chr('39')39chr('39'))39chr(chr('39')39chr('39')))39chr(chr(chr('39')39chr('39'))39chr(chr('39')39chr('39'))))s economy by developing strategic ties and expanding cooperation with countries in the region and the world. Expanding rela...
متن کاملConfluence Modulo Equivalence in Constraint Handling Rules
Previous results on confluence for Constraint Handling Rules, CHR, are generalized to take into account user-defined state equivalence relations. This allows a much larger class of programs to enjoy the advantages of confluence, which include various optimization techniques and simplified correctness proofs. A new operational semantics for CHR is introduced that reduces notational overhead sign...
متن کاملA CHR-Based Solver for Weak Memory Behaviors
With the wide expansion of multiprocessor architectures, the analysis and reasoning for programs under weak memory models has become an important concern. This work presents an original constraint solver for detecting program behaviors respecting a particular memory model. It is implemented in Prolog using CHR (Constraint Handling Rules). The CHR formalism provides a convenient generic solution...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005